import { createApp } from 'vue'
// import { createPinia } from 'pinia'
import App from './App.vue'
import i18n from "./lang";
import router from './router'
import 'lib-flexible/flexible'
import 'virtual:svg-icons-register'
import {BaseIcon} from '@/components/icon/index'
import 'element-plus/dist/index.css'
// 引入状态管理
import { setupStore } from '@/stores/index.ts'
import '@/common/index.less'
import 'uno.css'
import './assets/main.css'


const setupAll = async () => {
    const app = createApp(App)
    await setupStore(app)
    app.component('BaseIcon',BaseIcon) 
    app.use(i18n)
    // app.use(createPinia())
    app.use(router)
    
    
    // 全局过滤器
    // app.config.globalProperties.$filters = {
    //   prefix(url) {
    //     if (url && url.startsWith('http')) {
    //       return url
    //     } else {
    //       url = `http://backend-api-01.newbee.ltd${url}`
    //       return url
    //     }
    //   }
    // }
    app.mount('#app')
}



setupAll()